package com.stylefeng.guns.modular.hhtb.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.stylefeng.guns.modular.hhtb.model.Account;
import com.stylefeng.guns.modular.hhtb.dao.AccountMapper;
import com.stylefeng.guns.modular.hhtb.model.AccountDto;
import com.stylefeng.guns.modular.hhtb.service.IAccountService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 用户账户表 服务实现类
 * </p>
 *
 * @author stylefeng
 * @since 2018-08-29
 */
@Service
public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> implements IAccountService {

    @Autowired
    private AccountMapper accountMapper;
    @Override
    public List<AccountDto> selectAllq2List() {
        List<AccountDto> list = accountMapper.selectAllq2List();
        return list;
    }

    @Override
    public List<Map<String, Object>> selectAll(Page<Map<String, Object>> page, AccountDto accountDto) {
        List<Map<String, Object>> list = accountMapper.selectAll(page, accountDto);
        Integer total = accountMapper.selectAllCount(accountDto);
        page.setTotal(total);
        return list;
    }
}
